package com.itheima.demo;

import java.io.BufferedReader;
import java.io.IOException;

import java.io.InputStreamReader;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @author Zhang_Han
 * @version 1.0
 * @date 2020/7/16 15:25
 */
public class Demo_TCP_Server01 {
    public static void main(String[] args) throws IOException {
        ServerSocket ss = new ServerSocket(9999);
        Socket sk = ss.accept();
        //InputStreamReader isr = new InputStreamReader(is);
        BufferedReader br = new BufferedReader(new InputStreamReader(sk.getInputStream()));
        String line;
        while ((line = br.readLine())!=null) {
            System.out.println(line);
        }
        br.close();
        ss.close();
    }
}
